package repository

import (
	"gitee.com/ling1314/origin-utility/db"
	"gitee.com/ling1314/origin-utility/model"
)

type topologyRepository struct{}

func (r topologyRepository) Save(str string) (err error) {
	err = db.GetDB().Save(&model.Topology{
		Id:      model.DefaultTopologyId,
		Content: str,
	}).Error
	return
}

func (r topologyRepository) Get() (m model.Topology, err error) {
	err = db.GetDB().Model(&model.Topology{}).Where("id = ?", model.DefaultTopologyId).Find(&m).Error
	return
}
